#include<stdio.h>

void connect(char str[],char str1[],char str2[])
{
	char *s1=str1;
	char *s2=str2;
	int i=0;
	while(*s1!='\0')
	{
		str[i]=*s1;
		s1++;
	}
	while(*s2!='\0')
	{
		str[i]=*s2;
		s2++;
	}
	s1[i]='\0';
}

int main()
{
	char str[120],str1[30]={"one word"},str2[30]={"one dream"};
	printf("The first string is:%s\n",str1);
	
	printf("The second string is:%s\n",str2);
	
	printf("The connect1 string is:\n");
	snprintf(str,120,"%s %s",str1,str2);
	printf("%s\n",str);
	printf("The connect2 string is:\n");
	connect(str,str1,str2);
	printf("%s\n",str);
	return 0;
}
